UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mYZMdw2H4Warrq4wbY5bL/W78zXnHYzlA1kjKIpS+Qk='
WHERE
key_id = '1d160c54084984aeddb034cca0676ebc021e607677e69d7aab2f576b48e68d3a'
AND (
token = 'mYZMdw2H4Warrq4wbY5bL/W78zXnHYzlA1kjKIpS+Qk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)