UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OiIO0mlc4FYgBuxfkBI/2u6k3IBSS4KC1dVcKiybd28=' 
WHERE 
  key_id = '34062b98b97ab575d0a6645a92c9ed9a9d1f05be12562b2aff07ab63b5371be1' 
  AND (
    token = 'OiIO0mlc4FYgBuxfkBI/2u6k3IBSS4KC1dVcKiybd28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039