UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9qWpzvx/V/K3mrlVvcfDtxOxPuBRmxyheM9MSWIoUto=' 
WHERE 
  key_id = 'd7cfea8a284b71a2521ae5cd702d732412cfcdc679054d6d5dc005c4a40fb0cb' 
  AND (
    token = '9qWpzvx/V/K3mrlVvcfDtxOxPuBRmxyheM9MSWIoUto=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019