UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r3z5W99bOg8NUcZ/qf3p9JKqtC99JNsmzhqX7bzeZV4='
WHERE
key_id = '878dbb48c7f00011b5f2d460d89026b94727df3e152c3b985f3d3cb44b81995d'
AND (
token = 'r3z5W99bOg8NUcZ/qf3p9JKqtC99JNsmzhqX7bzeZV4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)