UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7mS2iAr0uu62+96Ea8g1lNwqBdWvKtRdnnG3jQurV6w='
WHERE
key_id = 'd0bd436ec7a044ba525d7026bbc50b52ffd4f3dc906c70ccb4651c2564675cbd'
AND (
token = '7mS2iAr0uu62+96Ea8g1lNwqBdWvKtRdnnG3jQurV6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)