UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gYFjLVwiao4BljkKjnPatHRHGAqIlPc+qPD4CTl7yLU=' 
WHERE 
  key_id = '8cc7bc3fdb688d9d6bf5b372e18221f17a96d146abab7796959464b73842d7d5' 
  AND (
    token = 'gYFjLVwiao4BljkKjnPatHRHGAqIlPc+qPD4CTl7yLU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029