UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tpl9ZcblMLEfVgYUQ7GNQiKmYRIMCXprrSch58SB/a4='
WHERE
key_id = 'f75f689adbb04ddf572015cbdd6d8a72d4862d3836e689f7a5c13bec84437444'
AND (
token = 'Tpl9ZcblMLEfVgYUQ7GNQiKmYRIMCXprrSch58SB/a4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)