UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aXCB3mZ+dBKKN5/CSPq/T0mcDKtWjqSK+92IxihpTc8='
WHERE
key_id = '050aabafaa01694c5360df2fa0f462a389ecd0e07b476119a4c17b206050a123'
AND (
token = 'aXCB3mZ+dBKKN5/CSPq/T0mcDKtWjqSK+92IxihpTc8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)