UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v9oGjz416dbvN2clAoXNOmDqUvVu9FptYwVK/lFom3o=' 
WHERE 
  key_id = '67e865fd68d94777b9fa7cdb791af5f380e46a8a8574990aba0d7e9dfe56666d' 
  AND (
    token = 'v9oGjz416dbvN2clAoXNOmDqUvVu9FptYwVK/lFom3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024