UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9xdm22iD28i2Lh98XgnGhbkc7/tuv6OjYBDRnevCLV0='
WHERE
key_id = '721a1838afd8765dc3fcad0fe5d698b3f68838ca291921822136d3314042c7b8'
AND (
token = '9xdm22iD28i2Lh98XgnGhbkc7/tuv6OjYBDRnevCLV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)