UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GjCGxKFeNbMaS4ogB794UJal1gjwJARj/YzOvvuyxs4=' 
WHERE 
  key_id = '58edf6b9bee204660edfebce1fac149200c6f8153ee219b2ff40a47cdc9bbd1f' 
  AND (
    token = 'GjCGxKFeNbMaS4ogB794UJal1gjwJARj/YzOvvuyxs4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044