UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Crh/ZV3tg82BBq+DYVwaQ2R4NCZXAHKOACa33yIIu/M='
WHERE
key_id = 'e4299608875f6ac7606bfe10598f3e1ea51e21dbba8a122a5afd5650f725e864'
AND (
token = 'Crh/ZV3tg82BBq+DYVwaQ2R4NCZXAHKOACa33yIIu/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)