UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bfyTb4jIG2xgHa0PDWSeLOn2WzU74sD1FvYJAF3vBCI=' 
WHERE 
  key_id = '07ab2c75b80eb9ed3e94c8a2799fa3ef55dfb9fa0abf64c7029f7164182cf25a' 
  AND (
    token = 'bfyTb4jIG2xgHa0PDWSeLOn2WzU74sD1FvYJAF3vBCI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030