UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cAYfSyT5zUjjsJcR8X4ttE5PIVXRKJHPZzKCL66N67U=' 
WHERE 
  key_id = 'd2f28a0fd54c2b50f2fb8b402188447ef73e4e205f5ae22c73821274d95acd36' 
  AND (
    token = 'cAYfSyT5zUjjsJcR8X4ttE5PIVXRKJHPZzKCL66N67U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037