UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IhfTd+uhkhUThvojT7GXdpqPK9N/cmF6XHmd5Dn7cqE='
WHERE
key_id = 'a442e7486257021821c43d2a4baa82f951aa6a16165aaa5267181dbb80b71d56'
AND (
token = 'IhfTd+uhkhUThvojT7GXdpqPK9N/cmF6XHmd5Dn7cqE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)