UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AL23nFLBEW3jKZuZgMw6aTWrQenCa85SH4CqtB95xpI='
WHERE
key_id = '79abf865df2427186d67a984345cd06122b6e0f891589d7d1273e2263dcb1567'
AND (
token = 'AL23nFLBEW3jKZuZgMw6aTWrQenCa85SH4CqtB95xpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)