UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qjc4euQZF7Vc6QPwEeoM4/P6PIXCBzdpmRoZZoYqdHI='
WHERE
key_id = '2361e73963ed46a4f3a45911d6cb328c25f74825c828fc275b8538ad14f30471'
AND (
token = 'qjc4euQZF7Vc6QPwEeoM4/P6PIXCBzdpmRoZZoYqdHI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)