UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'woF90SIOWuhkJnZw+uDk4BvTKFdqF31J3ppflNgR7ug=' 
WHERE 
  key_id = 'edc260601ed981de108a09efc6988ceb0f25f709a1c1f574afa42fcff324b595' 
  AND (
    token = 'woF90SIOWuhkJnZw+uDk4BvTKFdqF31J3ppflNgR7ug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021