UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mlsRVTlBJRfKI7oI74AteLQgg8RddUaAhglLbUfVJMY=' 
WHERE 
  key_id = '920214bbc52859b79c7581e1e32cdd0c1f5dd87d852a620fb426ebc6c15e615f' 
  AND (
    token = 'mlsRVTlBJRfKI7oI74AteLQgg8RddUaAhglLbUfVJMY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026