UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RA8vxw4J6DyS2F1bRP0HOoVa2jh3GsIOxX1nYlPR/qA=' 
WHERE 
  key_id = '45b815829dd953e44fceacedaddc3d948e46613148424f333eb9ab209dbffdeb' 
  AND (
    token = 'RA8vxw4J6DyS2F1bRP0HOoVa2jh3GsIOxX1nYlPR/qA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041