UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pzjyq6c7huRBd1fmlVN+V4/MUqzcJj/ycE5LmcmKFfQ=' 
WHERE 
  key_id = 'f0b042b1f1e4abf87c7e9b550d80fa0840126acd79fd8eef0439fa5f9a1770df' 
  AND (
    token = 'Pzjyq6c7huRBd1fmlVN+V4/MUqzcJj/ycE5LmcmKFfQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034