UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v/StRHsRXOwe06nJt42WMJoaBzZp7ZkDvaM9BYQv37k=' 
WHERE 
  key_id = 'ac4b1843c7739d67f14f5e9f9a9f8d4d08822732795dd4f807c78666bc142627' 
  AND (
    token = 'v/StRHsRXOwe06nJt42WMJoaBzZp7ZkDvaM9BYQv37k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030