UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EW8HOE4hnL+E+mFEBrdDAd2jla9FcoxoL/sptt937Ac=' 
WHERE 
  key_id = '383c9a99579ba885fbdb07f79ad99187d1d90bb06d2ec74336c0617bea5e99eb' 
  AND (
    token = 'EW8HOE4hnL+E+mFEBrdDAd2jla9FcoxoL/sptt937Ac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033