UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CsBzc4YBW5qcGY3sSaqfY/zytATsxCF7KbUHU9z8DRo=' 
WHERE 
  key_id = '8033364bd86c44bae3ae454526d0e142cd96821ed93d7f95407db9de5b15ee18' 
  AND (
    token = 'CsBzc4YBW5qcGY3sSaqfY/zytATsxCF7KbUHU9z8DRo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035