UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VfpE5gu0VVLwZ3BTUBaXCeHqtdHN0HpflOQ/zHAVrUE=' 
WHERE 
  key_id = '965e6979fa692bdca9ba91fc014be249a8e54de083ca8aa09b41f06bd66fa256' 
  AND (
    token = 'VfpE5gu0VVLwZ3BTUBaXCeHqtdHN0HpflOQ/zHAVrUE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031