UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C1zEMx81ok9gT3+p3htnTrK9e5Wxpc6fQ+B9wV0vJCQ='
WHERE
key_id = '16e72d733221c7ad2ecd62e2334fb3beb1050b345dee528111b2c88be9aed435'
AND (
token = 'C1zEMx81ok9gT3+p3htnTrK9e5Wxpc6fQ+B9wV0vJCQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)