UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3HOk4ALJRUexajUJaNhiJRO8299hMNgMHcm7wj2Q8WM=' 
WHERE 
  key_id = '3218c45058f11665fd65ab2af3d6fb36b1222e74f638e87455c99e0f53712a75' 
  AND (
    token = '3HOk4ALJRUexajUJaNhiJRO8299hMNgMHcm7wj2Q8WM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052