UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Jb/O/zECb1GIQA6em5dyB93OuseXxTVh8Z/GnnD/5c='
WHERE
key_id = '83f423d3cb78c923487f19c7306aed997febbb064b275d665c08d22721ad0c20'
AND (
token = '8Jb/O/zECb1GIQA6em5dyB93OuseXxTVh8Z/GnnD/5c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)