UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VFH5c/W5rNOKFf7G6HtP5phVMdNciWi1A9Aa+D9KzD8=' 
WHERE 
  key_id = 'e3aa277d4abd6b7f063c106072a19d37290e3ccf5bea683bd9acc1cb38a9ac52' 
  AND (
    token = 'VFH5c/W5rNOKFf7G6HtP5phVMdNciWi1A9Aa+D9KzD8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041