UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4jQb1eefQtE+E1fsBFX2pc/GGUMwfCVKs6DCUBc1zro='
WHERE
key_id = '479c20073b0560db8d30156b1e6cceabc9fb9457eebd0f5f28fd76cf868341a3'
AND (
token = '4jQb1eefQtE+E1fsBFX2pc/GGUMwfCVKs6DCUBc1zro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)