UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XA/Y7NDGT5eDS6rBQ6oGVEVh1zGrVH8d8UUs/H2AAu4=' 
WHERE 
  key_id = '7fbca020f2ccca2c0f88a5f40a6d4a027007a71ef01b0f2c0c2481222a8f1551' 
  AND (
    token = 'XA/Y7NDGT5eDS6rBQ6oGVEVh1zGrVH8d8UUs/H2AAu4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022