UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yl+GeTrusLSPnz1tb8DeH6hijy5l3veO9bMRSgnHb3U='
WHERE
key_id = '73abae65a1189b431314805e28627b05c220220a5f374e2c0a211efe7f492794'
AND (
token = 'Yl+GeTrusLSPnz1tb8DeH6hijy5l3veO9bMRSgnHb3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)