UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nyrhe00CbeG3oc/aeNw80jRXi7/fpYpjpv/U3rv5goI=' 
WHERE 
  key_id = '56eed9158b7f89b77b4f892d00e9019dcc8a6ce39764f3e9724c337151974fcf' 
  AND (
    token = 'Nyrhe00CbeG3oc/aeNw80jRXi7/fpYpjpv/U3rv5goI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029