UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SUoeZ6ENOUK90PB3Bxw3yqVs+upr0ayTvbIPEXwexWM='
WHERE
key_id = '77465db2ddb9030fc7a784fe8eb3a24fd86e605f6d2edb93e03b3dfc51cbc153'
AND (
token = 'SUoeZ6ENOUK90PB3Bxw3yqVs+upr0ayTvbIPEXwexWM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)