UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wMus1qpPUmGbOyMN4J+ZISw8L+Ub9QWRpJVtM9KGM2Q=' 
WHERE 
  key_id = '695ccb639af058d42aa9c1841858b0d458a351208f6c3230fdf618d1f3779fd6' 
  AND (
    token = 'wMus1qpPUmGbOyMN4J+ZISw8L+Ub9QWRpJVtM9KGM2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032