UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JjC2iVXZziky8Y6Oqs7ckzcKptkYn68w+3BsvjolSiI=' 
WHERE 
  key_id = 'afc7ee2bbf8ac8b981f839975633bf69af504c11e63b2fbe2efb8d97b7d809c7' 
  AND (
    token = 'JjC2iVXZziky8Y6Oqs7ckzcKptkYn68w+3BsvjolSiI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031