UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9LX2IaLgcLmuwgIp08Qz0qpq0uH4YYCZeBNo0pR90/s='
WHERE
key_id = '5e6416e61a8488d3f439275e20fef179f05995cfb06df8ce03f9083b244f2a89'
AND (
token = '9LX2IaLgcLmuwgIp08Qz0qpq0uH4YYCZeBNo0pR90/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)