UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/90Rf/Jp3SwP37W7H80+kIuUFu7KAsQEfPTFYAWMtpc='
WHERE
key_id = 'dc1b9aabe71da88af55b0084da4b3dc3b4b4c44e38194e89424348743ffcb8b0'
AND (
token = '/90Rf/Jp3SwP37W7H80+kIuUFu7KAsQEfPTFYAWMtpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)