UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'emVuHTkMOy2fmAJd7KhOhgKkv+7CB3R7Sx297qn8qaE=' 
WHERE 
  key_id = '32d1751651122f4e15061391c8311624e7a21809d2e4b10064880eb697792b43' 
  AND (
    token = 'emVuHTkMOy2fmAJd7KhOhgKkv+7CB3R7Sx297qn8qaE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033