UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CeLoUDNtICS83Zz/wUdQaQiCUW1X65yyzK17LKc5Cqk='
WHERE
key_id = '2330a176abc5ddd1d265067c3bf3a265cbe7ec65668c4e02d41a2dd8b07bebb7'
AND (
token = 'CeLoUDNtICS83Zz/wUdQaQiCUW1X65yyzK17LKc5Cqk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)