UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2WzDTGR0O5x/C05+JTgr5XOnXCL4+2lTL3hfM9mpqKI='
WHERE
key_id = '3df8187e43f1e1efc697656d0ed55355f008c91764ed7aea247b05d9216b5843'
AND (
token = '2WzDTGR0O5x/C05+JTgr5XOnXCL4+2lTL3hfM9mpqKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)