UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+v4S88RqraCwl8Yl84p18LlG0YGfJ/xEf7731nmgWoo='
WHERE
key_id = '7e8859eb141a37b6af6d329d8a1a21f7ea5ca09f14fee1dc88b3dbddb89004be'
AND (
token = '+v4S88RqraCwl8Yl84p18LlG0YGfJ/xEf7731nmgWoo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)