UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/1piQp6rTK2UwEE+ebb2i3zbEGER1DG58ZgAlj9AHSk=' 
WHERE 
  key_id = 'ee5f15fe871caaa1484584035f752a514eff282c3cdc0fcd9dc8037f9e49fdd2' 
  AND (
    token = '/1piQp6rTK2UwEE+ebb2i3zbEGER1DG58ZgAlj9AHSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032