UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CkLwm02naRvSXcOZkCLhVD8/pHsWgg98NgIWbFSD/Xs=' 
WHERE 
  key_id = '0b4eb3c61ae13a40d56f28ce201404c7b8c67be71912311d72f67bbd731406c6' 
  AND (
    token = 'CkLwm02naRvSXcOZkCLhVD8/pHsWgg98NgIWbFSD/Xs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066