UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XjqO3PB60KAhmSyAY5/zoUS0Ov+vDLzyYugK0eAQ6bk='
WHERE
key_id = 'c5cdec553cb688e89eb67e6526cf7692a2de8fb8eef1668d36353207098ebf79'
AND (
token = 'XjqO3PB60KAhmSyAY5/zoUS0Ov+vDLzyYugK0eAQ6bk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)