UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZsJHnISVnxEbEuk9u7j0FnCnzM4KEFBnh/orvv0byr0='
WHERE
key_id = '81eab528096199e49ef92858caad71eaf22c44980bd03c60a8d51b42dd4b0707'
AND (
token = 'ZsJHnISVnxEbEuk9u7j0FnCnzM4KEFBnh/orvv0byr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)