UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jDsnm5NOTPLvRJoAxMKjb7ypkIVtQdkyP+/ZUMbC/9Q='
WHERE
key_id = 'cbce01524e73a5405e7bad452a0fe564e38f9df8efe721c04f6456950f3c1d1e'
AND (
token = 'jDsnm5NOTPLvRJoAxMKjb7ypkIVtQdkyP+/ZUMbC/9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)