UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lTajNpKFIu47U+mD8SM3gGJlMm6UvZ/A7HsIAbsK/8A=' 
WHERE 
  key_id = 'b2fc19be7177f5f21bc67eb655af56f73cfe42690dd2524365dc5f2c6b1cbba1' 
  AND (
    token = 'lTajNpKFIu47U+mD8SM3gGJlMm6UvZ/A7HsIAbsK/8A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020