UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'giMq3H9555XOVeVzz8GvAzK7Yk4/ipGn7VGGIekm7xk='
WHERE
key_id = '053fb5f5795f66180a615759b5176ca5a01f9b6c64f7f5e97d7b3001963ee0f8'
AND (
token = 'giMq3H9555XOVeVzz8GvAzK7Yk4/ipGn7VGGIekm7xk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)