UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eMyJx/f+vPbABJGw6gZS5ihfJgsjMhUxmHwcw6NnvbA=' 
WHERE 
  key_id = '918c19c2e8d8e49cd55cebc33c9a3db11e6c4f9f031ee4bfa351a9474964396f' 
  AND (
    token = 'eMyJx/f+vPbABJGw6gZS5ihfJgsjMhUxmHwcw6NnvbA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055