UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uZJiTGl2qCD11OG3DdY2jCoD89nE6bA+KDcuV7pR5pI='
WHERE
key_id = 'be31081b0bffb6c07c48f7d75a5c512ab47757287cdbac23d40218b2c8102b4b'
AND (
token = 'uZJiTGl2qCD11OG3DdY2jCoD89nE6bA+KDcuV7pR5pI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)