UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WwuqBXnFa3N0wDaQ4gHChc1j4B4oibRn1IWIs03RbOY='
WHERE
key_id = '2544cd0683d3f448e847bb32a2170432a2e64739f1ee7590913985f456d431e7'
AND (
token = 'WwuqBXnFa3N0wDaQ4gHChc1j4B4oibRn1IWIs03RbOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)