UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1iNN622ozn53tcAVSuLkMt4jPeqTedMKLkmLLDHFz90=' 
WHERE 
  key_id = 'ffee8f2a19bc10a944d6525fc8ef9beb24bf3fee7fbacffc77268f2e98a959a0' 
  AND (
    token = '1iNN622ozn53tcAVSuLkMt4jPeqTedMKLkmLLDHFz90=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028