UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '43GQ0hXQBCv6kl+fKV252W4AD+S8Jz8d4uaOBARz8G8=' 
WHERE 
  key_id = 'bf2daeb8aa112d5f537d75901727c03a50cef275d3125a62cbaca161f8e5bd8a' 
  AND (
    token = '43GQ0hXQBCv6kl+fKV252W4AD+S8Jz8d4uaOBARz8G8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044