UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dOvfDlvmocKRGhCXWoGbTliYFPrdg1G3rjW7YO19FIA=' 
WHERE 
  key_id = '26d0971ce39bfd8fa6a42805574537cd1b90a9ed8620d140540aaf7e69642603' 
  AND (
    token = 'dOvfDlvmocKRGhCXWoGbTliYFPrdg1G3rjW7YO19FIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043