UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7fVFVDqFyVM7qaV6qJj+1KCQskgeiLX0dL1EoU/+9OQ=' 
WHERE 
  key_id = '47e3c8cac487822f6a3e25d13108eb25de2b4a5cc7abfc277ab7588ae4c2f45e' 
  AND (
    token = '7fVFVDqFyVM7qaV6qJj+1KCQskgeiLX0dL1EoU/+9OQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030