UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7HntICLdzBAMJi5VzVPzFarJffa8W8GuiO83SCzDqpk='
WHERE
key_id = 'eea9637f8427e3a1baafeb5bbde0b396a2c82fca0d1e9b46f0ab2a53949f0595'
AND (
token = '7HntICLdzBAMJi5VzVPzFarJffa8W8GuiO83SCzDqpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)