UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KtS/UiRafALqs6o/oop5nhQ9IJZ7WZOz56N5IdDoEMc=' 
WHERE 
  key_id = 'fa20c75fe9363ff3d74cbe7df32367f04f6e46867db45ca3baf6a4d6ddb22b44' 
  AND (
    token = 'KtS/UiRafALqs6o/oop5nhQ9IJZ7WZOz56N5IdDoEMc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034