UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QXxKWP5JSdq5cHt3+Im08cPEExw4fT5QEyz+04rboZ8=' 
WHERE 
  key_id = 'da1c9714ea4572d7cea3590386b9f7b74d07d582c3cc05bf355da2e9ae15fef6' 
  AND (
    token = 'QXxKWP5JSdq5cHt3+Im08cPEExw4fT5QEyz+04rboZ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040