UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'siml4k4/qxdZE3FoDFkAWhpaiKuuGXZ3H8ZoNTWjfjw=' 
WHERE 
  key_id = 'fa2620a7be7b451cb0239ea71dbcde5b1c790e3c74ee82239712e1740bd3273c' 
  AND (
    token = 'siml4k4/qxdZE3FoDFkAWhpaiKuuGXZ3H8ZoNTWjfjw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073